using System;
using System.Collections.Generic;
using System.Text;
using TAC;
using CenterSpace.Free;

namespace Arena
{
    sealed class FabricaNPC
	{
        private static FabricaNPC instancia = new FabricaNPC();

        public static FabricaNPC Instancia()
        {
            return instancia;
        }

		public NonPlayerCharacter criarNPC (int pontosBase)
		{
			int[] temporario, atributos;
			int a, b, c, d;
            MersenneTwister random = new MersenneTwister();

			a = random.Next(pontosBase/4) + 1;
			b = random.Next((pontosBase - a)/3) + 1;
			c = random.Next((pontosBase - (a + b))/2) + 1;
			d = pontosBase - (a + b + c);
			
			temporario = new int[] { a, d, c, b };
			atributos = GeradorPNJ.geraNPC(pontosBase, pontosBase/2, temporario);
			
			return new NonPlayerCharacter (ref atributos);
		}
		
		public NonPlayerCharacter criarNPC (int pontosBase, int[] atributos)
		{
            int[] temporario = GeradorPNJ.geraNPC(pontosBase, pontosBase / 2, atributos);
			
			return new NonPlayerCharacter (ref temporario);
		}
	}
}